import { axios } from '@/utils/request'

/**
 * 查询流程分类列表
 * @param query
 * @returns {*}
 */
export function pageCategory(query) {
  return axios({
    url: '/workflow/category/page',
    method: 'get',
    params: query
  })
}

/**
 * 查询流程分类列表
 * @param query
 * @returns {*}
 */
export function listAllCategory(query) {
  return axios({
    url: '/workflow/category/listAll',
    method: 'get',
    params: query
  })
}

/**
 * 查询流程分类详细
 * @param categoryId
 * @returns {*}
 */
export function getCategory(categoryId) {
  return axios({
    url: '/workflow/category/' + categoryId,
    method: 'get'
  })
}

/**
 * 查询流程分类编码的appType应用类型
 * @param code
 * @returns {*}
 */
export function getAppType(code) {
  return axios({
    url: '/workflow/category/appType/' + code,
    method: 'get'
  })
}

/**
 * 新增流程分类
 * @param data
 * @returns {*}
 */
export function addCategory(data) {
  return axios({
    url: '/workflow/category',
    method: 'post',
    data: data
  })
}

/**
 * 修改流程分类
 * @param data
 * @returns {*}
 */
export function updateCategory(data) {
  return axios({
    url: '/workflow/category',
    method: 'put',
    data: data
  })
}

/**
 * 删除流程分类
 * @param categoryId
 * @returns {*}
 */
export function delCategory(categoryId) {
  return axios({
    url: '/workflow/category/' + categoryId,
    method: 'delete'
  })
}
